<?php
/**
 * Created by PhpStorm.
 * User: zl
 * Date: 2017/7/9
 * Time: 23:04
 */
    require_once('../Common.php');
    require_once('OrdinaryFee.php');
    require_once ('../FinanceFeeManage/FinanceFeeManage.php');

    $data = $_POST;
    $return_array = array();
    if(!$data){
        $return_array['state'] = 0;
        $return_array['error'] = 'POST_ERROR';
        exit(json_encode($return_array));
    }

    $ffm = new FinanceFeeManage();
    $r = $ffm->isEnoughtSectionFeeToCheck($data['section_id'], $data['data']);
    if(!$r){
        exit(json_encode(array('state'=>2, 'error'=>'NO_ENOUGH_MONEY')));
    }

    $o_fee = new OrdinaryFee();
    echo json_encode($o_fee->createOrdinaryFeeApprove($data));






?>